From 3344bcaf92bf1659bd3db0a896edd01dcd3005f3 Mon Sep 17 00:00:00 2001 From: Vivek Kasireddy Date: Mon, 28 Dec 2020 18:20:04 -0800 Subject: [PATCH] gdk/wayland/surface: Expose gdk_wayland_surface_get_wl_egl_window() Some GTK based applications such as Qemu UI create and manage EGLSurfaces associated with the relevant GdkSurfaces. In order to create an EGLSurface, there needs to be a way to pass the native window object to eglCreateWindowSurface(). While running in an X environment, the native window object can be obtained by calling gdk_x11_surface_get_xid(). Likewise, the native window object can be obtained by calling gdk_wayland_surface_get_wl_egl_window() while running in a Wayland environment. Therefore, this API needs to be exposed to apps. Signed-off-by: Vivek Kasireddy --- gdk/wayland/gdksurface-wayland.c | 2 +- gdk/wayland/gdkwaylandsurface.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index dd0d1891fa..296acdf2bb 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -4209,7 +4209,7 @@ gdk_wayland_surface_get_wl_output (GdkSurface *surface) return NULL; } -static struct wl_egl_window * +struct wl_egl_window * gdk_wayland_surface_get_wl_egl_window (GdkSurface *surface) { GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); diff --git a/gdk/wayland/gdkwaylandsurface.h b/gdk/wayland/gdkwaylandsurface.h index 851a4d5607..180903ff7c 100644 --- a/gdk/wayland/gdkwaylandsurface.h +++ b/gdk/wayland/gdkwaylandsurface.h @@ -62,6 +62,9 @@ GType gdk_wayland_popup_get_type (void); GDK_AVAILABLE_IN_ALL struct wl_surface *gdk_wayland_surface_get_wl_surface (GdkSurface *surface); +GDK_AVAILABLE_IN_ALL +struct wl_egl_window *gdk_wayland_surface_get_wl_egl_window (GdkSurface *surface); + typedef void (*GdkWaylandToplevelExported) (GdkToplevel *toplevel, const char *handle, gpointer user_data); -- 2.30.2